public enum Main {
    RED("温习文",18),
    BLACK("温习",19),
    GREEN("张三",25),
    WHITE("李四",28);

    public String name;
    public int age;

    Main() {

    }

    Main(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public static void main(String[] args) {
        Enum<Main> en1 =  Main.valueOf("RED");
        Enum<Main> en2 =  Main.valueOf("GREEN");
        System.out.println(GREEN.compareTo(RED));
    }
    public static void main3(String[] args) {
        Enum<Main> en =  Main.valueOf("RED");
        System.out.println(en+" " + en.ordinal());
    }

    public static void main2(String[] args) {
        Main[] mains =  Main.values();

        for (int i = 0; i < mains.length; i++) {
            System.out.println(mains[i] + " " + mains[i].ordinal());
        }


    }
    public static void main1(String[] args) {
        Main main = Main.GREEN;

        switch(main) {

            case RED:
                System.out.println("红色");
                break;
            case BLACK:
                System.out.println("白色");
                break;
            case GREEN:
                System.out.println("黑色");
                break;
            case WHITE:
                System.out.println("蓝色");
                break;
        }
    }

}
